package com.atnjupt.admin.dao;

import com.atnjupt.admin.bean.City;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * @author Wizarder
 * @create 2021-10-24 13:00
 */
@Mapper
public interface CityDao {
    @Select("select * from city where id = #{id}")
    public abstract City getCityById(Integer id);

    @Insert("insert into city(`name`,`state`,`country`) values(#{name},#{state},#{country})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    public abstract void saveCity(City city);
}
